package com.totoro.motan.demo.properties;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 协议参数
 * Protocol用来配置Motan服务的协议。不同的服务适用不同的协议进行传输，可以自行扩展协议。
 * <motan:protocol id="" name="" />
 * Created by Niki on 2018/5/23 19:18
 */
@Configuration
@ConfigurationProperties(prefix = "motan.protocol")
@Getter
@Setter
public class ProtocolConfigProperties {
    private String name;

    private String serialization;

    private Integer payload;

    private Integer buffer;

    private Integer heartbeat;

    private String transporter;

    private Integer threads;

    private Integer iothreads;

    private Integer requestTimeout;

    /**
     * 限制客户端对每隔服务建立的连接数
     */
    private Integer minClientConnection;
    private Integer maxClientConnection;

    /**
     * 限制服务端连接池工作线程数
     */
    private Integer minWorkerThread;
    private  Integer maxWorkerThread;

    private Integer maxServerConnection;

    private Boolean poolLifo;

    private  Boolean lazyInit;

    private String cluster;

    /**
     * 负载均衡【ActiveWeight、Random、RoundRobin、LocalFirst、Consistent、ConfigurableWeight】
     * 缺省为 ActiveWeight（低并发有限），并支持自定义扩展。 负载均衡策略在Client端生效，因此需在Client端添加配置
     */
    private String loadbalance;

    /**
     * 容错策略【Failover、Failfast 】 默认Failover（出现失败重试其他服务器）
     * Motan 在集群调用失败时，提供了两种容错方案，并支持自定义扩展。 高可用集群容错策略在Client端生效，因此需在Client端添加配置
     */
    private  String haStrategy;


    private Integer workerQueueSize;

    private Integer acceptConnections;

    private String proxy;

    private String filter;

    private Integer retries;

    private Boolean async;

    private Integer queueSize;

    private Integer accepts;

    private String dispatcher;

    private  String server;

    private String client;

    private Boolean defaultConfig;

    private String switcherService;

    private String heartBeatFactory;






}
